﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Doctor/ViewMasterPage.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    Person
</asp:Content>

<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
     <div class="col-sm-9 col-sm-offset-3 col-lg-10 col-lg-offset-2 main">
         <div class="col-xs-6">
                        <form role="form">
                            <div class="form-group">
                                <label>姓名：</label>
                                <input class="form-control" id="Placeholder_Update" value="<%: ViewData["UserName"] %>">
                            </div>
                             <div class="form-group">
                                <label>密码：</label>
                                <input class="form-control" type="password" id="password_Update" value="<%: ViewData["UserPassword"] %>">
                            </div>
                            <div class="row">
                                <div class="col-xs-4">
                                    <div class="form-group">
                                        <label>科室：</label>
                                        <div class="form-group">
                                            <select class="selectpicker form-control" id="office_Select_Update">
                                                <option>内科</option>
                                                <option>外科</option>
                                                <option>妇产科</option>
                                                <option>儿科</option>
                                            </select>
                                        </div>
                                    </div>
                                </div>
                                <div class="col-xs-4">
                                    <label>年龄：</label>
                                    <input class="form-control" id="old_TxtBox_Update" value="<%:ViewData["UserOld"] %>">
                                </div>
                                <div class="col-xs-4">
                                    <label>性别：</label>
                                    <div class="form-group">
                                        <select class="selectpicker form-control" id="sex_Select_Update">
                                            <option>男       </option>
                                            <option>女       </option>

                                        </select>
                                    </div>
                                </div>

                            </div>
                            <div class="form-group">
                                <label>联系电话：</label>
                                <input class="form-control" id="tel_TxtBox_Update" value="<%:ViewData["UserTel"] %>">
                            </div>

                            <div class="form-group">
                                <label>邮箱：</label>
                                <input class="form-control" id="email_TxtBox_Update" value="<%:ViewData["UserEmail"] %>">
                            </div>

                            <label>被监护者</label>
                            <div class="form-group has-success">
                                <input class="form-control" placeholder="1号患者ID" value="<%:ViewData["User1Id"] %>" id="UserId_Update1">
                            </div>
                            <div class="form-group has-success">
                                <input class="form-control" placeholder="2号患者ID" value="<%:ViewData["User2Id"] %>" id="UserId_Update2">
                            </div>
                            <div class="form-group has-success">
                                <input class="form-control" placeholder="3号患者ID" value="<%:ViewData["User3Id"] %>" id="UserId_Update3">
                            </div>
                        </form>
                    
                   
             </div>
         <div class="col-xs-6">
             <div class="form-group">
                 <label>1号</label>
                 <div class="form-group has-success">
                     <input class="form-control" placeholder="1号患者姓名" readonly value="<%:ViewData["User1"] %>">
                 </div>
                 <div class="form-group has-success">
                     <input class="form-control" placeholder="1号患者手机"   readonly value="<%:ViewData["User1Tel"] %>">
                 </div>
                 <div class="form-group has-success">
                     <input class="form-control" placeholder="1号患者邮箱" readonly value="<%:ViewData["User1Email"] %>">
                 </div>
             </div>
                <div class="form-group">
                 <label>2号</label>
                 <div class="form-group has-success">
                     <input class="form-control" placeholder="2号患者姓名" readonly value="<%:ViewData["User2"] %>">
                 </div>
                 <div class="form-group has-success">
                     <input class="form-control" placeholder="2号患者手机" readonly value="<%:ViewData["User2Tel"] %>">
                 </div>
                 <div class="form-group has-success">
                     <input class="form-control" placeholder="2号患者邮箱" readonly value="<%:ViewData["User2Email"] %>">
                 </div>
             </div>
                <div class="form-group">
                 <label>3号</label>
                 <div class="form-group has-success">
                     <input class="form-control" placeholder="3号患者姓名" readonly value="<%:ViewData["User3"] %>">
                 </div>
                 <div class="form-group has-success">
                     <input class="form-control" placeholder="3号患者手机" readonly value="<%:ViewData["User3Tel"] %>">
                 </div>
                 <div class="form-group has-success">
                     <input class="form-control" placeholder="3号患者邮箱" readonly value="<%:ViewData["User3Email"] %>">
                 </div>
             </div>
              <div class="modal-footer">
                        <button type="button" class="btn btn-default"
                            data-dismiss="modal">
                            取消修改
                        </button>
                        <button type="button" class="btn btn-primary" id="dialog_btn_update">
                            提交修改
                        </button>
              </div>
         </div>
         </div>
</asp:Content>

<asp:Content ID="Content3" ContentPlaceHolderID="LeftMenuContent" runat="server">   
    <li><a href="/Doctor/Index"><span class="glyphicon glyphicon-dashboard"></span>首页</a></li>
    <li><a href="/Doctor/Widgets"><span class="glyphicon glyphicon-th"></span>医生</a></li>
    <li><a href="/Doctor/Charts"><span class="glyphicon glyphicon-stats"></span>用户</a></li>
    <li><a href="/Doctor/Tables"><span class="glyphicon glyphicon-list-alt"></span>监护数据</a></li>
    <li><a href="/Doctor/Forms"><span class="glyphicon glyphicon-pencil"></span>管理员</a></li>
    <li><a href="/Doctor/Panels"><span class="glyphicon glyphicon-info-sign"></span>操作记录</a></li>
</asp:Content>

<asp:Content ID="Content4" ContentPlaceHolderID="JsContent" runat="server">
    <script>
        $('#dialog_btn_update').click(function () {
            $tab_Json = eval(JSON.stringify($table.bootstrapTable('getSelections')));
            $("#myModal_Update").modal('hide');
            $.post("/Doctor/SetDoctor", {
                "name": $('#Placeholder_Update').val(),
                "id1": $('#UserId_Update1').val(),
                "id2": $('#UserId_Update2').val(),
                "id3": $('#UserId_Update3').val(),
                "old": $('#old_TxtBox_Update').val(),
                "sex": $('#sex_Select_Update').val(),
                "offices": $('#office_Select_Update').val(),
                "tel": $('#tel_TxtBox_Update').val(),
                "email": $('#email_TxtBox_Update').val(),
            }, function (data) {
                if (data=="OK") {
                    $table.bootstrapTable('load', data);
                    alert("修改成功");
                }
                else {
                    alert("修改失败");
                }
            });
        });
    </script>
</asp:Content>
